home *** CD-ROM | disk | FTP | other *** search
- <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-
- <html><head>
-
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-
- <title>Baseball Cards</title></head>
-
- <body bgcolor="#FFFFFF">
-
- <p>
-
- <object id="cards" ondatasetcomplete="dataloaded()"
-
- classid="CLSID:333C7BC4-460F-11D0-BC04-0080C7055A83" width="192" height="192">
-
- <param name="DataURL" value="cards.txt">
-
- <param name="UseHeader" value="1">
-
- <param name="Sort" value="year; cardnumber">
-
- </object>
-
- </p>
-
-
-
- <h3 align="center">
-
- To filter the data for a specific year, enter the year here and click the
-
- Filter button:</h3>
-
- <form id="filterform">
-
- <div align="center"><center><h3>Year:
-
- <input type="text" name="FilterYear" size="20"></h3>
-
- </center></div>
-
- <div align="center"><center><h3>
-
- <input type="submit" value="Filter" name="B1" onclick="filteryear(0)">
-
- <input type="reset" value="Reset" name="B2" onclick="filteryear(1)">
-
- </h3></center></div>
-
- </form>
-
- <hr>
-
- <h3 align="center">Use any of these buttons to sort the data:</h3>
-
- <p align="center"><input type="button" value="Year/Card Number" name="B1"
-
- onclick="buttonclick(1)"><input type="button" value="Description" name="B2"
-
- onclick="buttonclick(2)"><input type="button" value="Year/Grade" name="B3"
-
- onclick="buttonclick(3)"><input type="button" value="Value" name="B4"
-
- onclick="buttonclick(4)"></p>
-
- <h3 align="center">Or, to sort by any column, click the column's header.</h3>
-
- <hr>
-
-
-
- <!-- START modified from Listing 18.4 -->
-
- <table border="1" datasrc="#cards" datapagesize=5
-
- align="center" cellpadding="2">
-
- <!-- END modified from Listing 18.4 -->
-
- <THEAD>
-
- <tr>
-
- <td align="left" id="year" onclick="tableclick('year')"
-
- bgcolor="#00FFFF"><big>+Year</big></td>
-
- <td align="left" id="CardNumber" onclick="tableclick('cardnumber')"
-
- bgcolor="#00FFFF"><big>+Number</big></td>
-
- <td align="left" id="setname" onclick="tableclick('setname')"
-
- bgcolor="#00FFFF"><big>Set Name</big></td>
-
- <td align="left" id="issuer" onclick="tableclick('issuer')"
-
- bgcolor="#00FFFF"><big>Issuer</big></td>
-
- <td align="left" id="description" onclick="tableclick('description')"
-
- bgcolor="#00FFFF"><big>Description</big></td>
-
- <td align="left" id="grade" onclick="tableclick('grade')"
-
- bgcolor="#00FFFF"><big>Grade</big></td>
-
- <td align="right" id="value" onclick="tableclick('value')"
-
- bgcolor="#00FFFF"><big>Value</big></td>
-
- </tr>
-
- </THEAD>
-
- <tr>
-
- <td><div datafld="year"></div></td>
-
- <td><div datafld="cardnumber"></div></td>
-
- <td><div datafld="setname"></div></td>
-
- <td><div datafld="issuer"></div></td>
-
- <td><div datafld="description"></div></td>
-
- <td><div datafld="grade"></div></td>
-
- <td width="50" align="right"><div datafld="value"></div></td>
-
- </tr>
-
- <TFOOT>
-
- <tr>
-
- <td colspan="6" align="right" height="40" bgcolor="#000080">
-
- <font color="#FF0000" size="4"><strong>Total:</strong></font></td>
-
- <td valign="center" align="right" bgcolor="#000080">
-
- <font color="#FF0000" size="4">
-
- <strong><div id="TotalText"></div></strong></font></td>
-
- </tr>
-
- </TFOOT>
-
- </table>
-
-
-
- <!-- START modified from Listing 18.4 -->
-
- <hr>
-
- <p id="pagesizetext" align="center">Page Size: 5</p>
-
- <p align="center"><strong><input type="button" value="Previous Page" name="B1"
-
- onclick="scrollpage(0)"> <input type="button" value="Next Page" name="B1"
-
- onclick="scrollpage(1)"> </strong></p>
-
-
-
- <p align="center"><input type="button" value="Decrease Page Size" name="B1"
-
- onclick="pagesize(0)"><strong>
-
- <input type="button" value="Increase Page Size" name="B1"
-
- onclick="pagesize(1)"></strong></p>
-
-
-
- <p align="center"><input type="button" value="Disable Table Paging" name="B1"
-
- onclick="pagesize(2)"></p>
-
- <!-- END modified from Listing 18.4 -->
-
-
-
- <script language="VBScript"><!--
-
- sub tableclick(columnname)
-
-
-
- if columnname <> "year" and
-
- cc] (left(document.all.item("year").innertext,1) = "+"
-
- cc] or left(document.all.item("year").innertext,1) = "-") then
-
- document.all.item("year").innerHTML = "<big>" +
-
- cc] mid(document.all.item("year").innertext,2) + "</big>"
-
- end if
-
-
-
- if columnname <> "cardnumber" and
-
- cc] (left(document.all.item("cardnumber").innertext,1) = "+" or
-
- cc] left(document.all.item("cardnumber").innertext,1) = "-") then
-
- document.all.item("cardnumber").innerHTML = "<big>" +
-
- cc] mid(document.all.item("cardnumber").innertext,2) + "</big>"
-
- end if
-
-
-
- if columnname <> "setname" and
-
- cc] (left(document.all.item("setname").innertext,1) = "+" or
-
- cc] left(document.all.item("setname").innertext,1) = "-") then
-
- document.all.item("setname").innerHTML = "<big>" +
-
- cc] mid(document.all.item("setname").innertext,2) + "</big>"
-
- end if
-
-
-
- if columnname <> "issuer" and
-
- cc] (left(document.all.item("issuer").innertext,1) = "+" or
-
- cc] left(document.all.item("issuer").innertext,1) = "-") then
-
- document.all.item("issuer").innerHTML = "<big>" +
-
- cc] mid(document.all.item("issuer").innertext,2) + "</big>"
-
- end if
-
-
-
- if columnname <> "description" and
-
- cc] (left(document.all.item("description").innertext,1) = "+" or
-
- cc] left(document.all.item("description").innertext,1) = "-") then
-
- document.all.item("description").innerHTML = "<big>" +
-
- cc] mid(document.all.item("description").innertext,2) + "</big>"
-
- end if
-
-
-
- if columnname <> "grade" and
-
- cc] (left(document.all.item("grade").innertext,1) = "+" or
-
- cc] left(document.all.item("grade").innertext,1) = "-") then
-
- document.all.item("grade").innerHTML = "<big>" +
-
- cc] mid(document.all.item("grade").innertext,2) + "</big>"
-
- end if
-
-
-
- if columnname <> "value" and
-
- cc] (left(document.all.item("value").innertext,1) = "+" or
-
- cc] left(document.all.item("value").innertext,1) = "-") then
-
- document.all.item("value").innerHTML = "<big>" +
-
- cc] mid(document.all.item("value").innertext,2) + "</big>"
-
- end if
-
-
-
- if left(document.all.item(columnname).innertext,1) = "+" then
-
- document.all.item(columnname).innerHTML = "<big>-" +
-
- cc] mid(document.all.item(columnname).innertext,2) + "</big>"
-
- cards.sort = "-" + columnname
-
- elseif left(document.all.item(columnname).innertext,1) = "-" then
-
- document.all.item(columnname).innerHTML = "<big>+" +
-
- cc] mid(document.all.item(columnname).innertext,2) + "</big>"
-
- cards.sort = columnname
-
- else
-
- document.all.item(columnname).innerHTML = "<big>+" +
-
- cc] document.all.item(columnname).innertext + "</big>"
-
- cards.sort = columnname
-
- end if
-
-
-
- cards.reset
-
-
-
- end sub
-
-
-
- sub buttonclick(button)
-
-
-
- if (left(document.all.item("year").innertext,1) = "+" or
-
- cc] left(document.all.item("year").innertext,1) = "-") then
-
- document.all.item("year").innerHTML = "<big>" +
-
- cc] mid(document.all.item("year").innertext,2) + "</big>"
-
- end if
-
-
-
- if (left(document.all.item("cardnumber").innertext,1) = "+" or
-
- cc] left(document.all.item("cardnumber").innertext,1) = "-") then
-
- document.all.item("cardnumber").innerHTML = "<big>" +
-
- cc] mid(document.all.item("cardnumber").innertext,2) + "</big>"
-
- end if
-
-
-
- if (left(document.all.item("setname").innertext,1) = "+" or
-
- cc] left(document.all.item("setname").innertext,1) = "-") then
-
- document.all.item("setname").innerHTML = "<big>" +
-
- cc] mid(document.all.item("setname").innertext,2) + "</big>"
-
- end if
-
-
-
- if (left(document.all.item("issuer").innertext,1) = "+" or
-
- cc] left(document.all.item("issuer").innertext,1) = "-") then
-
- document.all.item("issuer").innerHTML = "<big>" +
-
- cc] mid(document.all.item("issuer").innertext,2) + "</big>"
-
- end if
-
-
-
- if (left(document.all.item("description").innertext,1) = "+" or
-
- cc] left(document.all.item("description").innertext,1) = "-") then
-
- document.all.item("description").innerHTML = "<big>" +
-
- cc] mid(document.all.item("description").innertext,2) + "</big>"
-
- end if
-
-
-
- if (left(document.all.item("grade").innertext,1) = "+" or
-
- cc] left(document.all.item("grade").innertext,1) = "-") then
-
- document.all.item("grade").innerHTML = "<big>" +
-
- cc] mid(document.all.item("grade").innertext,2) + "</big>"
-
- end if
-
-
-
- if (left(document.all.item("value").innertext,1) = "+" or
-
- cc] left(document.all.item("value").innertext,1) = "-") then
-
- document.all.item("value").innerHTML = "<big>" +
-
- cc] mid(document.all.item("value").innertext,2) + "</big>"
-
- end if
-
-
-
- select case button
-
- case 1
-
- document.all.item("year").innerHTML = "<big>+" +
-
- cc] document.all.item("year").innertext + "</big>"
-
- document.all.item("cardnumber").innerHTML = "<big>+" +
-
- cc] document.all.item("cardnumber").innertext + "</big>"
-
- cards.sort = "year; cardnumber"
-
- case 2
-
- document.all.item("description").innerHTML = "<big>+" +
-
- cc] document.all.item("description").innertext + "</big>"
-
- cards.sort = "description"
-
- case 3
-
- document.all.item("year").innerHTML = "<big>+" +
-
- cc] document.all.item("year").innertext + "</big>"
-
- document.all.item("grade").innerHTML = "<big>+" +
-
- cc] document.all.item("grade").innertext + "</big>"
-
- cards.sort = "year; grade"
-
- case 4
-
- document.all.item("value").innerHTML = "<big>+" +
-
- cc] document.all.item("value").innertext + "</big>"
-
- cards.sort = "value"
-
- end select
-
-
-
- cards.reset
-
- end sub
-
-
-
- sub filteryear(reset)
-
-
-
- if reset then
-
- fstring = ""
-
- else
-
- fstring = "year = " + document.forms("filterform").item("filteryear").value
-
- end if
-
-
-
- cards.filter = fstring
-
- cards.reset
-
-
-
- end sub
-
-
-
- <!-- START modified from Listing 18.4 -->
-
- sub scrollpage(direction)
-
-
-
- if direction = 0 then
-
- mytable.previouspage
-
- else
-
- mytable.nextpage
-
- end if
-
-
-
- end sub
-
-
-
- sub pagesize(direction)
-
-
-
- if direction = 0 and mytable.datapagesize > 1 then
-
- mytable.datapagesize = mytable.datapagesize - 1
-
- document.all.pagesizetext.innertext = "Page Size: "
-
- cc] + cstr(mytable.datapagesize)
-
- elseif direction = 1 then
-
- mytable.datapagesize = mytable.datapagesize + 1
-
- document.all.pagesizetext.innertext = "Page Size: "
-
- cc] + cstr(mytable.datapagesize)
-
- elseif direction = 2 then
-
- mytable.datapagesize = 0
-
- document.all.pagesizetext.innertext = "Table paging disabled"
-
- end if
-
-
-
- end sub
-
- <!-- END modified from Listing 18.4 -->
-
-
-
- sub dataloaded()
-
-
-
- while not(cards.recordset.eof)
-
- total = total + cards.recordset("value")
-
- cards.recordset.movenext
-
- wend
-
- document.all.totaltext.innertext = total
-
-
-
- end sub
-
- --></script>
-
- </body></html>
-
-